#include "IPFactory.hh"

IPFactory::IPFactory(TimeoutQueue* AssignedQueue)
: PFactory(AssignedQueue)
{
	
}

USNumber IPFactory::predictNumOfWorker()
{
	USNumber Return;
    Return = PFactory::predictNumOfWorker();
	
	ResultOf Result;
	if (Return != Misprediction)
	{
		RealMinNumOfWorker = InfoOfFactory->tellMin();
		Result = InfoOfFactory->setMin(InfoOfFactory->tellMax());
		checkErrorWR(Result, "Fail InfoOfFactory->setMin.");
	}
	else
	{
		Result = InfoOfFactory->setMin(RealMinNumOfWorker);
		checkErrorWR(Result, "Fail InfoOfFactory->setMin.");
	}
	
	return Return;
}
